// Learn TypeScript:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html

const { ccclass, property } = cc._decorator;

@ccclass
export default class CombatTxtComp extends cc.Component {
    @property(cc.Label)
    txt: cc.Label = null;
    @property(cc.Animation)
    anim: cc.Animation = null;



    drawTxt(str: string, color: cc.Color) {
        this.txt.string = str;
        this.txt.node.color = color;
    }
    protected onEnable(): void {
        this.anim.play("CombatTxt");
    }
}
